home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
alph100p.zip
/
ALPHA.INT
< prev
next >
Wrap
Text File
|
1991-11-02
|
7KB
|
226 lines
{$A+,B-,D-,E-,F+,G-,I-,L-,N-,O-,R-,S-,V-,X-}
Unit ALPHA;
(************************************************************************)
(* *)
(* OFFERING TEXT DISPLAY FUNCTIONS FOR *)
(* MULTI-TASKING ENVIRONMENTS *)
(* *)
(* FEATURING *)
(* *)
(* MULTIPLE VIDEO PAGES *)
(* NO DIRECT VIDEO MEMORY UPDATES *)
(* NO USE OF VIDEO PORTS *)
(* USE OF STANDARD BIOS OUTPUT FUNCTIONS *)
(* USE OF STANDARD INPUT/OUTPUT *)
(* *)
(************************************************************************)
INTERFACE
Uses WOW; { Requires version 1.01 of WOW }
Type
Str4 = string[4];
Str7 = string[7];
Str16 = string[16];
Str80 = string[80];
CursorShapes = ( OFF, ON, BlOCK);
EGARows = ( at43, at50 );
AlphaChoices = ( No_AlphaExit,
No_MainExit,
Cga_Mode,
Ega_Mode,
Cga16_mode );
VideoCards = ( NOCARD, MDA, CGA, EGA, PGA, VGA, MCGA );
Bkgrd = ( Black8, Blue8, Green8, Cyan8,
Red8, Magenta8, Brown8, White8);
Const
AlphaVer = '1.00';
DirectVideo : boolean = FALSE; { NOT USED BY ALPHA}
CheckSnow : boolean = FALSE; { NOT USED BY ALPHA}
{ Filler Characters }
Space = #032; Star = #042;
ShadeLight = #176; ShadeMedium = #177;
ShadeHeavy = #178; Crosshatch = #197;
CrossWeave = #206;
{ MONO ColorAttrS }
Normal = $07; Underlined = $01;
Reversed = $70; Invisible = $00;
{ TEXT modes }
BW40 = 0; { 40x25 B/W on Color Adapter }
CO40 = 1; { 40x25 Color on Color Adapter }
BW80 = 2; { 80x25 B/W on Color Adapter }
CO80 = 3; { 80x25 Color on Color Adapter }
Mono = 7; { 80x25 on Monochrome ONLY Adapter }
Font8x8 = 256; { EGA/VGA 8x8 FONT with 43/50 LINES}
EgaVga = 256; { EGA/VGA 8x8 FONT with 43/50 LINES}
{ C O L O R A T T R I B U T E C O N S T A N T S }
{-------------------------------------------------------------------}
{ ForeGround }
{ Low Intensity Background } { EGA/VGA High Intensity Background }
Black = 00; DarkGray = 08; Blink = 128;
Blue = 01; LightBlue = 09;
Green = 02; LightGreen = 10;
Cyan = 03; LightCyan = 11;
Red = 04; LightRed = 12;
Magenta = 05; LightMagenta = 13;
Brown = 06; Yellow = 14;
LightGray = 07; White = 15;
Var
LastProc : Pointer; { Points to Optional Main Exit Procedure }
LastMode : integer; { Provided for compatibility with CRT }
{****************************************** CRT FUNCTIONS SUPPORTED }
Procedure ClrEol ;
Procedure DelLine ;
Procedure HighVideo ;
Procedure InsLine ;
Procedure LowVideo ;
Procedure NormVideo ;
Procedure TextBackground ( Color: byte);
Procedure TextColor ( Color: byte);
Procedure TextMode ( Mode: integer);
Function WhereX : byte;
Function WhereY : byte;
{********************************************** NEW FUNCTIONS ADDED }
{ VIDEO }
Procedure AltPrintScr ;
Procedure ChangeColorXY ( X,Y,Len,Foreground, Background: byte);
procedure ChangeBackgroundXY ( X,Y,Len,Color: byte);
procedure ChangeForegroundXY ( X,Y,Len,Color: byte);
Procedure Change8ColorXY ( X,Y,Len,Foreground: Byte;
Background: Bkgrd);
procedure Change8BackgroundXY ( X,Y,Len: byte; Color: Bkgrd);
Procedure Cursor ( Shape: CursorShapes);
Procedure Display ( X,Y: byte; S: string);
Procedure Echo ( S: string);
Procedure EchoLn ( S: string);
Procedure DisplayOver ( X,Y: byte; S: string);
Procedure EndofLine ;
Procedure FillPage ( Ch: Char);
Function GetActivePage : Pages;
Function GetBackGround ( ColorAttr: byte)
: byte;
Function GetForeGround ( ColorAttr: byte)
: byte;
Procedure GetBoth ( var ColorAttr: byte; CH: char);
Function GetColorAttr : byte;
Function GetChar : char;
Procedure GotoX ( X: byte);
Procedure GotoY ( Y: byte);
Procedure Home ;
Procedure MakeAlphaChoice ( Text: AlphaChoices);
Function MaxCols : byte;
Function MaxRows : byte;
Procedure Prepare8Page ( P: Pages;C: CursorShapes;
Foreground: byte; Background: Bkgrd);
Procedure PreparePage ( P: Pages;C: CursorShapes;
Foreground,Background: byte);
Procedure ReverseColorXY ( X,Y,Len: byte);
Procedure SetColor ( Foreground, Background: byte);
Procedure Set8Color ( Foreground: byte; Background: Bkgrd);
Procedure SetActivePage ( Num: Pages);
Procedure SetBorder ( Color: byte);
Procedure SetPage ( P: Pages);
Procedure SetEGALines ( Num: EGARows);
Procedure TerminateOn ( V: VideoCards);
Function VideoAdapter : VideoCards;
Procedure WhereXY ( var X,Y: byte);
Procedure WriteCharOver ( Ch: char; Num: word);
{ Bonus String }
Function Color2Str ( C: Byte): Str16;
Function Int2Str ( Num: longint; Width: byte)
: str80;
Function Real2Str ( Num: real; Width,Decimals: byte)
: str80;
Function Pages2Str ( P: Pages)
: str7;
Function VideoAdapter2Str ( V: Videocards)
: Str4;